<?php
require_once 'db.php';
class keyword extends db{       //thua ke
    public $name ;      //thuoc tinh
    public function select(){   //phuong thuc
        $this->getconnection();    
        $query = 'SELECT * FROM keywords';
        $keywords = $this->query($query);
        return $keywords;
    }
    public function strlens() {
        $this->getconnection();
        $query = 'SELECT * FROM keywords';
        $keywords = $this->query($query);
        foreach ($keywords as $keywords_s) {
            if (strlen($keywords_s['name']) >= 10) {
                echo $keywords_s['id'] . '-';
                echo $keywords_s['name'] . '<br>';
            }
        }
    }
    
        //    public function strlenss() {
        //        $this->getconnection();
        //        $query = 'SELECT * FROM keywords
        //                    GROUP BY name
        //                    HAVING MAX(LENGTH(name)) >= 10';
        //        $keywords = $this->query($query);
        //        return $keywords;
        //    }
}

